package net.aias.springaichat.adapter.openapi;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.io.IOException;

/**
 * @Auther: cheng.tang
 * @Date: 2025/5/7
 * @Description: spring-ai-chat
 */
@Slf4j
@Controller
@RequestMapping
public class TestMappingController {

    @GetMapping("/payment/callback")
    @PostMapping("/payment/callback")
    public void frontRcvResponseDoPost(HttpServletRequest request, HttpServletResponse resp) throws IOException {
        log.info("Received request: {}", request.getMethod());
    }

    @RequestMapping(value = "/payment/callback/both", method = {RequestMethod.GET, RequestMethod.POST})
    public void frontRcvResponseDoPostBoth(HttpServletRequest request, HttpServletResponse resp) throws IOException {
        log.info("Received request: {}", request.getMethod());
    }

}
